Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use safe time as the default time #3315

Merged
merged 7 commits into from
Aug 23, 2021
Merged

Conversation

merceyz
Copy link
Member

@merceyz merceyz commented Aug 18, 2021

What's the problem this PR addresses?

  • The patch plugin isn't using the safe time when writing new files and creating their parent directory
  • The copyPromise algorithm isn't using the safe time
  • perf: convert chmod calls to mode arguments #3254 fixed a bug in ZipFS where writeFileSync didn't set the mode on files but didn't update the cache key causing checksum mismatches for patched packages where files are created (fsevents)

How did you fix it?

Moved the safe time to fslib, updated everything I could find to use it, and updated the cache version for the affected protocols

Checklist

  • I have read the Contributing Guide.
  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

@merceyz merceyz requested a review from arcanis as a code owner August 18, 2021 21:38
@merceyz merceyz marked this pull request as draft August 18, 2021 21:41
@merceyz merceyz marked this pull request as ready for review August 20, 2021 15:26
@merceyz
Copy link
Member Author

merceyz commented Aug 20, 2021

Comparing the archive for the patched fsevents from master with the one in this PR:

/node_modules
-atimeMs: 315532800000
+atimeMs: 456789000000
-mtimeMs: 315532800000
+mtimeMs: 456789000000
-ctimeMs: 315532800000
+ctimeMs: 456789000000
-birthtimeMs: 315532800000
+birthtimeMs: 456789000000
-atime: 1980-01-01T00:00:00.000Z
+atime: 1984-06-22T21:50:00.000Z
-mtime: 1980-01-01T00:00:00.000Z
+mtime: 1984-06-22T21:50:00.000Z
-ctime: 1980-01-01T00:00:00.000Z
+ctime: 1984-06-22T21:50:00.000Z
-birthtime: 1980-01-01T00:00:00.000Z
+birthtime: 1984-06-22T21:50:00.000Z

/node_modules/fsevents/vfs.js
-atimeMs: 315532800000
+atimeMs: 456789000000
-mtimeMs: 315532800000
+mtimeMs: 456789000000
-ctimeMs: 315532800000
+ctimeMs: 456789000000
-birthtimeMs: 315532800000
+birthtimeMs: 456789000000
-atime: 1980-01-01T00:00:00.000Z
+atime: 1984-06-22T21:50:00.000Z
-mtime: 1980-01-01T00:00:00.000Z
+mtime: 1984-06-22T21:50:00.000Z
-ctime: 1980-01-01T00:00:00.000Z
+ctime: 1984-06-22T21:50:00.000Z
-birthtime: 1980-01-01T00:00:00.000Z
+birthtime: 1984-06-22T21:50:00.000Z
-mode: 100666
+mode: 100644

@merceyz merceyz force-pushed the merceyz/fix/safe-time branch from a72fade to f86d2b0 Compare August 20, 2021 16:35
@arcanis arcanis merged commit 7ae458b into master Aug 23, 2021
@arcanis arcanis deleted the merceyz/fix/safe-time branch August 23, 2021 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants